# 实例一：A类
def increment_count():
    global count
    count += 1

def get_count():
    return count

# 实例一：B类
def decrement_count():
    global count
    count -= 1

def print_count():
    print("Count:", count)

# 实例二：A类——负责向表中添加元素
shared_list = []

def add_element(element):
    shared_list.append(element)

# 实例二：B类——负责从表中移除元素
def remove_element(element):
    shared_list.remove(element)

# 实例三：A类——负责向文件中写入数据
def write_to_file(data):
    with open('shared_file.txt', 'a') as file:
        file.write(data + '\n')

# 实例三：B类——负责从文件中读取数据
def read_from_file():
    with open('shared_file.txt', 'r') as file:
        return file.readlines()
